Skip to content

fix: inherit source type from babel#1286

Merged
jbroma merged 3 commits intocallstack:mainfrom
V3RON:fix/esmodule-property-in-cjs
Sep 9, 2025
Merged

fix: inherit source type from babel#1286
jbroma merged 3 commits intocallstack:mainfrom
V3RON:fix/esmodule-property-in-cjs

Conversation

@V3RON
Copy link
Copy Markdown
Contributor

@V3RON V3RON commented Sep 8, 2025

Summary

Babel can detect whether a file being transformed is an ESM or CJS and return this information. However, SWC assumes by default that it will transform only ESM files. This can lead to issues with default export interop in certain cases.
See: callstackincubator/rozenite#96

Test plan

Use the reproduction repository provided in the linked issue. Link this branch with the app and try running it. If there are no errors reported, everything works as expected.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Sep 8, 2025

🦋 Changeset detected

Latest commit: 648e140

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@callstack/repack Patch
@callstack/repack-plugin-expo-modules Patch
@callstack/repack-plugin-nativewind Patch
@callstack/repack-plugin-reanimated Patch
@callstack/repack-dev-server Patch
@callstack/repack-init Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
repack-website Ready Ready Preview Comment Sep 9, 2025 7:26am

Copy link
Copy Markdown
Contributor

@jbroma jbroma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 nit, LGTM otherwise 👍

please also add a changeset 🙏

Comment thread packages/repack/src/loaders/babelLoader/babelLoader.ts Outdated
@V3RON V3RON marked this pull request as ready for review September 9, 2025 07:26
Copy link
Copy Markdown
Contributor

@jbroma jbroma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jbroma jbroma merged commit 2598d36 into callstack:main Sep 9, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants